﻿using FServer.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace FServer.Controllers
{
    public class TVBController : Controller
    {
        NguoiDungDAO nddao = new NguoiDungDAO();
        //
        // GET: /Facebook/

        public ActionResult Index()
        {
            return View();
        }

        public NguoiDung getNguoiDungByUsername(String userName)
        {
            return nddao.getNguoiDungByName(userName);
        }

        public bool KetBan(String userName, String userFriendName)
        {
            try
            {
                nddao.themBanBe(userName, userFriendName);
            }
            catch{
                return false;
            }
            
            return true;
        }

        public bool GoiYKetBan(String userName, String userFriendName)
        {
            try
            {
                nddao.themYeuCauKetBan(userName, userFriendName);
            }
            catch{
                return false;
            }

            return true;
        }

        public bool HuyKetBan(String userName, String userFriendName)
        {
            try
            {
                nddao.huyKetBan(userName, userFriendName);
            }
            catch
            {
                return false;
            }

            return true;
        }

        public bool HuyGoiYKetBan(String userName, String userFriendName)
        {
            try
            {
                nddao.huyYeuCauKetBan(userName, userFriendName);
            }
            catch
            {
                return false;
            }

            return true;
        }
       
    }
}
